const path = require("path");
const cors = require("cors");
const express = require("express");
const app = express();
app.listen(300, () => {
    console.log("启动了");
});
app.use(cors()); //解决跨域
app.use(express.urlencoded({ extended: false })); //获取post请求体
//加载路由模块
let user = require(path.join(__dirname, "routers", "books.js"));
app.use("/api", user); //每一个接口都加上/api开头的前缀